const fs = require('fs');
const path = require('path');

console.time('async');
//异步  data 为文件内容数据
fs.readFile(path.join(__dirname,'./35.fs sync.js'),'utf8',(error,data)=>{
    if(error) throw error;
    console.log(data);
})

console.timeEnd('async');


console.time('sync');
//同步
fs.readFileSync(path.join(__dirname,'./35.js'),'utf8',(error,data)=>{
    if(error) throw error;
    console.log(data);
})
console.timeEnd('sync');